import requests
from celery import shared_task


@shared_task
def download_file():
    img_url = 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Flmg.jj20.com%2Fup%2Fallimg%2F1114%2F010421142927%2F210104142927-8-1200.jpg&refer=http%3A%2F%2Flmg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1669026511&t=5349e7c6d33b433dd887d2ac8b6d9829'
    resp = requests.get(img_url)
    print('hehehehe')

    with open('/home/gengwenhao/result.webp', mode='wb') as fp:
        fp.write(resp.content)


@shared_task
def say_welcome():
    print('welcome')


if __name__ == '__main__':
    download_file()
